<template>

  <div class="CardList">
      <v-container>
        <v-row>
          <v-col v-for="image in images">
            <v-card
                class="mx-auto my-12"
                max-width="323"
                hover
                :to="image.pages"
            >
              <v-card-title class="justify-center">{{image.title}}</v-card-title>
              <v-img
                  :src="image.src"
                  height="460px"
                  width="323"
                  class="justify-center"
              >
              </v-img>

              <v-card-actions>
                <v-spacer></v-spacer>
                <v-btn
                    text
                    color="teal accent-4"
                    @click.prevent="redirect(image.id, image.type)"
                >

                  查看课程
                  <v-icon>mdi-chevron-double-right</v-icon>
                </v-btn>
              </v-card-actions>
            </v-card>
          </v-col>
        </v-row>
      </v-container>
  </div>
</template>

<script>
export default {
  name: "CardList",
  data:()=>({
    images: [
      {id:56, type:0, pages:'wireless', src:'http://www.lynchpin.com.cn/uploadfile/2021/0302/20210302092233163.png',title:'无线通信'},
      {id:5, type:1, pages:'computer', src:'http://www.lynchpin.com.cn/uploadfile/2019/0319/20190319024152286.png',title:'计算机软件'},
      {id:55, type:0, pages:'intelligence', src:'http://www.lynchpin.com.cn/uploadfile/2021/0301/20210301092138399.png',title:'人工智能'},
      {id:3, type:0, pages:'information', src:'http://www.lynchpin.com.cn/uploadfile/2019/0318/20190318094535255.jpg',title:'信息科普'},
      {id:6, type:0, pages:'test_and_job', src:'http://www.lynchpin.com.cn/uploadfile/2020/0130/20200130124713506.jpg',title:'招考就业'},
      {id:9, type:0, pages:'school', src:'http://www.lynchpin.com.cn/uploadfile/2019/0319/20190319024227688.png',title:'临菲学堂'},
    ],
  }),
  methods:{
    redirect: function (id,type){
      if (type===0){
        window.location = 'https://edu.lynchpin.com.cn/course/'+id;
      }else{
        window.location = 'https://edu.lynchpin.com.cn/open/course/'+id;
      }

}
  }
}
</script>

